DECLARE curTask CURSOR FOR 
--Select TaskID, CaseSourceID FROM tblTask
--Where CreatedDate Between '30-Sep-2014' And GetDate()
select T.TaskID, T.CaseSourceID from tbCallsEscalatedToACRA_Sep2014 CT 
INNER JOIN tblTask T ON CT.TaskID = T.TaskID
Where BNInfo1 IS NULL
Order By T.ClosedDate DESC

--Select BNInfo1 FROM tblTask
--Where CreatedDate Between '30-Sep-2014' And GetDate()
--And BNInfo1 IS NOT NULL

OPEN curTask

--Select top 100 * from tblContactHistory 
--Where BNInfo1 > 0
--Order By ContactHistoryID DESC

Declare @TaskID bigint, @CaseSourceID smallint
FETCH NEXT FROM curTask
INTO @TaskID, @CaseSourceID

WHILE @@FETCH_STATUS = 0
BEGIN

--Select @TaskID, @CaseSourceID
EXEC sproceTaskEscalatedToACRAUpdate @TaskID = @TaskID, @CaseSourceID = @CaseSourceID

FETCH NEXT FROM curTask
INTO @TaskID, @CaseSourceID
END

CLOSE curTask
DEALLOCATE curTask